package com.globallogic.dmytro_zakharenko.university.lessons;

import java.util.ArrayList;
import java.util.Arrays;

public class Seminar {
	
	private double mSeminarStartTime; 
	private ArrayList<String> mSeminarDays;
	final public double SEMINARDURATION = 1.5;
	
	/**
	 * set seminar start time 
	 * 
	 * @param seminarStartTime
	 */
	public void setSeminarStartTime(double seminarStartTime) {
		this.mSeminarStartTime = seminarStartTime;
	}
	
	/**
	 * get seminar start time 
	 * 
	 * @return mSeminarStartTime
	 */
	public double getSeminarStartTime() {
		return mSeminarStartTime;
	}
	
	/**
	 * set schedule for the seminar 
	 * 
	 * @param seminarDates array of days in the week 
	 */
	public void setSchedule(ArrayList<String> seminarDates) {
		this.mSeminarDays = seminarDates;
	}
	
	/**
	 * get schedule for the seminar 
	 * 
	 * @return mSeminarDays array of days in the week
	 */
	public ArrayList<String> getSchedule() {
		return mSeminarDays;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Arrays.hashCode(mSeminarDays.toArray(new String[0]));
		long temp;
		temp = Double.doubleToLongBits(mSeminarStartTime);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Seminar other = (Seminar) obj;
		if (!Arrays.equals(mSeminarDays.toArray(new String[0]), other.mSeminarDays.toArray(new String[0])))
			return false;
		if (mSeminarStartTime != other.mSeminarStartTime)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Seminar [mSeminarStartTime=" + mSeminarStartTime
				+ ", mSeminarDays=" + Arrays.toString(mSeminarDays.toArray(new String[0]))
				+ ", SEMINARDURATION=" + SEMINARDURATION + "]";
	}
}	
